<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title> JavaScript标识放置

        <Head>...</Head>头部之间</title>
    <script type="text/javascript">
        var ODiv = document.getElementById("context");
        console.log(ODiv); // 打印出null
    </script>
</head>

<body>
    <div id="context">你好</div>
</body>

</html>